home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / common1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-19  |  4.0 KB  |  131 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Dialogs"
  5.    ClientHeight    =   3555
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2205
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   3555
  13.    ScaleWidth      =   2205
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.CommandButton Command3 
  16.       Caption         =   "Show Font"
  17.       Height          =   495
  18.       Left            =   120
  19.       TabIndex        =   4
  20.       Top             =   1440
  21.       Width           =   1935
  22.    End
  23.    Begin VB.CommandButton Command5 
  24.       Caption         =   "Show Color"
  25.       Height          =   495
  26.       Left            =   120
  27.       TabIndex        =   3
  28.       Top             =   2640
  29.       Width           =   1935
  30.    End
  31.    Begin VB.CommandButton Command4 
  32.       Caption         =   "Show Printer"
  33.       Height          =   495
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   2040
  37.       Width           =   1935
  38.    End
  39.    Begin VB.CommandButton Command2 
  40.       Caption         =   "Show Save"
  41.       Height          =   495
  42.       Left            =   120
  43.       TabIndex        =   1
  44.       Top             =   840
  45.       Width           =   1935
  46.    End
  47.    Begin VB.CommandButton Command1 
  48.       Caption         =   "Show Open"
  49.       Height          =   495
  50.       Left            =   120
  51.       TabIndex        =   0
  52.       Top             =   240
  53.       Width           =   1935
  54.    End
  55. Attribute VB_Name = "Form1"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. Option Explicit
  61. Private Sub Command1_Click()
  62. Dim sOpen As SelectedFile
  63. Dim Count As Integer
  64. Dim FileList As String
  65.     On Error GoTo e_Trap
  66.     FileDialog.sFilter = "Text Files (*.txt)" & Chr$(0) & "*.sky" & Chr$(0) & "All Files (*.*)" & Chr$(0) & "*.*"
  67.     ' See Standard CommonDialog Flags for all options
  68.     FileDialog.flags = OFN_EXPLORER Or OFN_LONGNAMES Or OFN_HIDEREADONLY Or OFN_ALLOWMULTISELECT
  69.     FileDialog.sDlgTitle = "Show Open"
  70.     FileDialog.sInitDir = App.Path & "\"
  71.     sOpen = ShowOpen(Me.hWnd)
  72.     If Err.Number <> 32755 And sOpen.bCanceled = False Then
  73.         FileList = "Directory : " & sOpen.sLastDirectory & vbCr
  74.         For Count = 1 To sOpen.nFilesSelected
  75.             FileList = FileList & sOpen.sFiles(Count) & vbCr
  76.         Next Count
  77.         Call MsgBox(FileList, vbOKOnly + vbInformation, "Show Open Selected")
  78.     End If
  79.     Exit Sub
  80. e_Trap:
  81.     Exit Sub
  82.     Resume
  83. End Sub
  84. Private Sub Command2_Click()
  85. Dim sSave As SelectedFile
  86. Dim Count As Integer
  87. Dim FileList As String
  88.     On Error GoTo e_Trap
  89.     FileDialog.sFilter = "Text Files (*.txt)" & Chr$(0) & "*.sky" & Chr$(0) & "All Files (*.*)" & Chr$(0) & "*.*"
  90.     ' See Standard CommonDialog Flags for all options
  91.     FileDialog.flags = OFN_HIDEREADONLY
  92.     FileDialog.sDlgTitle = "Show Save"
  93.     FileDialog.sInitDir = App.Path & "\"
  94.     sSave = ShowSave(Me.hWnd)
  95.     If Err.Number <> 32755 And sSave.bCanceled = False Then
  96.         FileList = "Directory : " & sSave.sLastDirectory & vbCr
  97.         For Count = 1 To sSave.nFilesSelected
  98.             FileList = FileList & sSave.sFiles(Count) & vbCr
  99.         Next Count
  100.         Call MsgBox(FileList, vbOKOnly + vbInformation, "Show Save Selected")
  101.     End If
  102.     Exit Sub
  103. e_Trap:
  104.     Exit Sub
  105.     Resume
  106. End Sub
  107. Private Sub Command3_Click()
  108. Dim sFont As SelectedFont
  109.     On Error GoTo e_Trap
  110.     FontDialog.iPointSize = 12 * 10
  111.     sFont = ShowFont(Me.hWnd, "Times New Roman")
  112.     Exit Sub
  113. e_Trap:
  114.     Exit Sub
  115. End Sub
  116. Private Sub Command4_Click()
  117.     On Error GoTo e_Trap
  118.     Call ShowPrinter(Me.hWnd)
  119.     Exit Sub
  120. e_Trap:
  121.     Exit Sub
  122. End Sub
  123. Private Sub Command5_Click()
  124. Dim sColor As SelectedColor
  125.     On Error GoTo e_Trap
  126.     sColor = ShowColor(Me.hWnd)
  127.     Exit Sub
  128. e_Trap:
  129.     Exit Sub
  130. End Sub
  131.